package android.demo.timer;

import android.demo.BaseActivity;
import android.os.Bundle;

public class TimerActivity extends BaseActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
//		//这样是不行的
//		private timer = new Timer();
//		timer.schedule(new TimerTask() {
//			
//			
//			public void run() {
//				setTitle("Demo" + System.currentTimeMillis());
//			}
//		}, 0, 2000);
		
        HandleTimer mTimer = new HandleTimer() {
            
            protected void onTime() {
                // 在这里做更新ui的操作
                setTitle("Demo" + System.currentTimeMillis());
            }
        };
        mTimer.start(0, 2000); 
	}
}
